home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: 2 June 1999
- //
- // Procedure Name:
- // performPolyRotateUVs
- //
- // Description:
- // Rotates UVs
- //
- // Input Arguments:
- // $option : Whether to set the options to default values.
- // Return Value:
- // command string iff $option==2
- //
-
- proc setOptionVars (int $forceFactorySettings)
- {
- if ($forceFactorySettings || !`optionVar -exists polyRotateUVAngle`) {
- optionVar -floatValue polyRotateUVAngle 90;
- }
- }
-
- global proc performPolyRotateUVsSetup (string $parent, int $forceFactorySettings)
- {
- setOptionVars($forceFactorySettings);
- setParent $parent;
-
- float $ang = `optionVar -q polyRotateUVAngle`;
- floatSliderGrp -edit -value $ang polyRotateUVAngle;
- }
-
- global proc performPolyRotateUVsCallback (string $parent, int $doIt)
- {
- setParent $parent;
-
- float $ang = `floatSliderGrp -query -value polyRotateUVAngle`;
- optionVar -floatValue polyRotateUVAngle $ang;
-
- if ($doIt) {
- performPolyRotateUVs 0;
- addToRecentCommandQueue "performPolyRotateUVs 0" "PolyRotateUVs";
- }
- }
-
- proc polyRotateUVsOptions ()
- {
- string $layout = getOptionBox();
- setParent $layout;
-
- setUITemplate -pushTemplate DefaultTemplate;
- waitCursor -state 1;
- tabLayout -scr true -tv false;
-
- string $parent = `columnLayout -adjustableColumn 1`;
-
- string $commandName = "performPolyRotateUVs";
- string $callback = ($commandName + "Callback " + $parent + " ");
- string $setup = ($commandName + "Setup " + $parent + " ");
-
- setOptionBoxCommandName($commandName);
-
- floatSliderGrp -label "Rotation Angle" -min -360.0 -max 360.0 -v 90.0 polyRotateUVAngle;
-
- waitCursor -state 0;
- setUITemplate -popTemplate;
-
- string $applyBtn = getOptionBoxApplyBtn();
- button -edit -label "Rotate"
- -command ($callback + 1)
- $applyBtn;
- string $saveBtn = getOptionBoxSaveBtn();
- button -edit
- -command ($callback + 0 + "; hideOptionBox")
- $saveBtn;
- string $resetBtn = getOptionBoxResetBtn();
- button -edit
- -command ($setup + 1)
- $resetBtn;
-
- setOptionBoxTitle("Rotate UVs Options");
-
- setOptionBoxHelpTag( "RotateUVs" );
-
- eval (($setup + 0));
- showOptionBox();
- }
-
- proc string assembleCmd()
- {
- int $doHistory = `constructionHistory -q -toggle`;
-
- string $cmd=("polyRotateUVs ");
-
- float $ang = `optionVar -q polyRotateUVAngle`;
- $cmd += $ang;
-
- return $cmd;
- }
-
- global proc string performPolyRotateUVs(int $option)
- {
- string $cmd="";
-
- switch ($option) {
- case 0:
- string $cmd=`assembleCmd `;
- string $res=`evalEcho $cmd`;
- break;
-
- case 1: polyRotateUVsOptions; break;
- case 2: $cmd=`assembleCmd`; break;
- default:
- $cmd = ("performPolyRotateUVs 0");
- }
- return $cmd;
- }
-
-